﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RegistTempUser.aspx.cs"
    Inherits="Web.Views.TempUserManage.RegistTempUser" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>注册临时用户</title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <script src="../../Javascript/jquery-1.5.2.min.js" type="text/javascript"></script>
    <script src="../../Javascript/jquery-ui.min.js" type="text/javascript"></script>
    <link href="../../App_Themes/NewPage/Styles/layout.css" rel="stylesheet" type="text/css" />
    <link href="../../App_Themes/NewPage/Styles/sexybuttons.css" rel="Stylesheet" type="text/css" />
    <link href="../../Easy_UI/themes/gray/easyui.css" rel="stylesheet" type="text/css" />
    <script src="../../Easy_UI/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../Easy_UI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript">
        function CheckLoginName() {
            var userName = $('#txtLoginName').val();
            if (userName == "") {
                $("#lblMsg").attr("class", "showError").html("用户名不能为空");
                return false;
            }
            else {
                RegExp = /^[a-zA-Z0-9_\u4e00-\u9fa5]{2,15}$/;
                if (!RegExp.test(userName)) {
                    $("#lblMsg").attr("class", "showError").html("用户名格式不符合规范");
                    return false;
                }
                else {
                    $.ajax({
                        type: "POST",
                        url: "TempUserServices.asmx/CheckLoginName",
                        data: { loginName: userName },
                        success: function (result) {
                            var sret = $(result).find("int").text();

                            if (sret == '1') {
                                $("#lblMsg").attr("class", "showError").html("抱歉，该用户名已有人使用！");
                                return false;
                            }
                            else {
                                $("#lblMsg").attr("class", "showOK").html("恭喜您可以使用该用户名");
                                return false;
                            }
                        }
                    });
                }
            }
        }

       
    </script>
    <style type="text/css">
        table
        {
            border: solid 1px #718BB7;
            padding: 0;
            letter-spacing: 0;
            font-size: 12px;
            text-align: left;
            margin-top: 5px;
            margin-bottom: 5px;
            border-collapse: collapse;
            border-spacing: 0;
        }
        table td
        {
            border: solid #B4C9C6 1px;
            border-collapse: separate;
        }
        .lable
        {
            text-align: right;
            color: #09347b;
            font-weight: bold;
            height: 22px;
            width: 20%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="height: 100px;">
    </div>
    <h3 style="margin: 0 auto; width: 50%;">
        注册临时用户</h3>
    <div style="margin: 0 auto; width: 50%;">
        <table cellpadding="0" cellspacing="0" class="editTable">
            <tr>
                <td class="lable" >
                    <span style="color: Red">*</span>登录名称
                </td>
                <td style="width: 50%">
                    <asp:TextBox runat="server" ID="txtLoginName" Width="250px" onblur="CheckLoginName()"></asp:TextBox>
                    
                </td>
                <td>
                <span id="lblMsg" style="color: Red">用户名字符串长度至少为6</span>
                </td>
            </tr>
            <tr>
                <td class="lable">
                    <span style="color: Red">*</span>登录密码
                </td>
                <td style="width: 150px">
                    <asp:TextBox runat="server" ID="txtPassword" Width="250px" TextMode="Password"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="lable">
                    <span style="color: Red">*</span>确认密码
                </td>
                <td style="width: 150px">
                    <asp:TextBox runat="server" ID="txtPassword2" Width="250px" TextMode="Password"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="lable">
                    用户姓名
                </td>
                <td style="width: 150px">
                    <asp:TextBox runat="server" ID="txtUserName" Width="250px"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="lable">
                    所在机构
                </td>
                <td style="width: 150px">
                    <asp:TextBox runat="server" ID="txtOrgName" Width="250px"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="lable">
                    身份证号
                </td>
                <td style="width: 150px">
                    <asp:TextBox runat="server" ID="txtIDCard" Width="250px"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="lable">
                    电话号码
                </td>
                <td style="width: 150px">
                    <asp:TextBox runat="server" ID="txtTelphone" Width="250px"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="lable">
                    手机号码
                </td>
                <td style="width: 150px">
                    <asp:TextBox runat="server" ID="txtMobile" Width="250px"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="lable">
                    过期时间
                </td>
                <td style="width: 150px">
                    <asp:TextBox runat="server" ID="txtExpirationTime" Width="250px" class="easyui-datebox"
                        editable="false"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="lable">
                </td>
                <td colspan="2">
                    <button type="button" class="sexybutton" runat="server" id="btnRegistTempUser"  
                    onserverclick="btnRegistTempUser_Click">
                        <span><span><span class="disk">注册</span></span></span></button>
                    <a href="DelayTempUser.aspx">申请延期</a>
                    <a href="TempUserLogin.aspx">返回临时登录</a>
                </td>
                
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
